﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DicitiControlLib;
using AxDicitiControlLib;
using System.IO;


namespace Emergency.Controls
{
    public partial class ExerciseEntrance : DevExpress.XtraEditors.XtraUserControl
    {

        public event FormButtonClickedHandler OnCommandClicked = null;
        public event FormButtonClickedHandler OnMonitorClicked = null;
        public event FormButtonClickedHandler OnHandlerClicked = null;
        public event FormButtonClickedHandler OnDispatchClicked = null;
        public event FormButtonClickedHandler OnMedicClicked = null;
        public event FormButtonClickedHandler OnProfessionClicked = null;
     

        private AxDCT3DWindow d3 = null;
        private IConfig _config = null;
        private IInformationTree _it = null;
        public ExerciseEntrance()
        {
            InitializeComponent();
            d3 = this.axDCT3DWindow1;
            _config = d3.config;
            _it = d3.infoTree;

            IInitializeResult res = _config.Initialize();
            if (res == null || res.isOK == false)
            {

                MessageBox.Show("三维控件初始化失败!");

            }
        }

        private void ExerciseEntrance_Load(object sender, EventArgs e)
        {
            _config.Load(Path.Combine(Application.StartupPath, @"DEMO0815\DEMO.cep"), string.Empty, false);
        }

        private void btnCommand_Click(object sender, EventArgs e)
        {
            if (OnCommandClicked != null)
            {
                this.OnCommandClicked(sender, e);
            }
        }

        private void btnMonitor_Click(object sender, EventArgs e)
        {
            if (OnMonitorClicked != null)
            {
                this.OnMonitorClicked(sender, e);
            }
        }

        private void btnHandler_Click(object sender, EventArgs e)
        {
            if (OnHandlerClicked != null)
            {
                this.OnHandlerClicked(sender, e);
            }
        }

        private void btnDispatch_Click(object sender, EventArgs e)
        {
            if (OnDispatchClicked != null)
            {
                this.OnDispatchClicked(sender, e);
            }
        }

        private void btnMedical_Click(object sender, EventArgs e)
        {
            if (OnMedicClicked != null)
            {
                this.OnMedicClicked(sender, e);
            }
        }

        private void btnProfession_Click(object sender, EventArgs e)
        {
            if (OnProfessionClicked != null)
            {
                this.OnProfessionClicked(sender, e);
            }
        }
    }
}
